//
//  GoodsSearchInforViewController.m
//  GLGW_Shoping
//
//  Created by yang on 2018/11/8.
//  Copyright © 2018年 yang. All rights reserved.
//

#import "GoodsSearchInforViewController.h"
#import "GoodsTopSelectView.h"
#import "SearchGoodsTableViewCell.h"
#import "StoreTopSelectView.h"
#import "InSaleGoodsTableViewCell.h"

@interface GoodsSearchInforViewController ()<UITableViewDelegate,UITableViewDataSource>

@end

@implementation GoodsSearchInforViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self ctreateTopView];
    self.tableView.height = self.tableView.height- kHeightProportion_In_iPhoneTriploid(44) - kHeightProportion_In_iPhoneTriploid(35);
    self.tableView.y = kHeightProportion_In_iPhoneTriploid(35);
    self.tableView.delegate =self;
    self.tableView.dataSource = self;
    self.tableView.mj_footer.hidden = YES;
    self.tableView.mj_header.hidden = YES;
    self.tableView.tableHeaderView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, kHeightProportion_In_iPhoneTriploid(10))];
    self.tableView.rowHeight = kHeightProportion_In_iPhoneTriploid(136);
    [self.view addSubview:self.tableView];
}

-(void)ctreateTopView {
    if (self.accountType == AccountType_Ordinary) {
        GoodsTopSelectView * g_view = [[GoodsTopSelectView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, kHeightProportion_In_iPhoneTriploid(35)) inSuperView:self.view];
    }else{
        StoreTopSelectView * toView = [[StoreTopSelectView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, kHeightProportion_In_iPhoneTriploid(34)) inSuperView:self.view];
    }
    
}

#pragma mark =================== UITableViewDelegate,UITableViewDataSource ===================
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 10;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    BaseTableViewCell * cell;
    if (self.accountType == AccountType_Ordinary) {
        SearchGoodsTableViewCell * cell_goods = [SearchGoodsTableViewCell cellWithTableView:tableView];
        cell = cell_goods;
    }else{
        InSaleGoodsTableViewCell * cell_insal = [InSaleGoodsTableViewCell cellWithTableView:tableView];
        cell = cell_insal;
    }
    
    return cell;
}

@end
